Keir Fraser [Tue, 27 Jan 2009 11:54:22 +0000 (11:54 +0000)]
x86-64: don't generate dependency files when building compat headers
The generated dependency files weren't correct (as their names get
derived only from the base name of the target file, and there are
public headers with the same base name in different directories), not
needed (as the makefile already listed all necessary dependencies
explicitly), and resulted in the first re-build in an already built
tree to be an almost full re-build since the *.c files explicitly
mentioned in the .*.d result in make not considering them as
intermediate anymore, thus triggering re-generation of the headers,
and hence re-building of almost the entire tree.
Keir Fraser [Sun, 25 Jan 2009 10:16:11 +0000 (10:16 +0000)]
vt-d: Do not explicitly exclude tboot ranges from dom0 vt-d
mappings. tboot is not registered as RAM in e820 tables, and hence
will not be mapped anyway (fails memory_is_conventional_ram() check).
Keir Fraser [Fri, 23 Jan 2009 12:50:14 +0000 (12:50 +0000)]
hvm bios: add PMM (a memory manager during POST)
The PMM (POST Memory Manager) offers malloc/free functionality
for PCI option ROMs during POST (Power On Self Test).
This patch adds a PMM functionality to the guest BIOS.
For example, the option ROM on LSI Logic SAS card uses PMM and
failed to initialize the device without PMM. Thus, the HVM can't
boot up directly from the passthroughed SCSI disk.
gPXE also uses PMM (I don't know what happens without PMM).
With this patch, we succeeded in SAS boot of HVM.
For further information about PMM:
http://www.phoenix.com/en/OEM-ODM/Customer+Services/White+Papers-Specs/PC+Industry+Specifications.htm
http://www.phoenix.com/NR/rdonlyres/873A00CF-33AC-4775-B77E-08E7B9754993/0/specspmm101.pdf
Keir Fraser [Fri, 23 Jan 2009 11:51:43 +0000 (11:51 +0000)]
bump libxenctrl and libxenguest versions
In c/s 19009 an incompatible change was made to the ABI of libelf-*,
which are included in libxenctrl and libxenguest. To avoid client
programs (such as python/lowlevel/xc/xc.so) picking up a wrong
version and perhaps crashing, the soname should be changed.
I have chosen the version number 3.4 as xen-unstable is currently the
pre-3.4 branch. I assume we don't care about API/ABI stability within
an unstable branch.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Thu, 22 Jan 2009 11:11:10 +0000 (11:11 +0000)]
x86 ucode: microcode logic update
Update microcode logic:
1. separate microcode_fini_cpu() into 2 level to avoid deadlock (when
fail at microcode_update_cpu);
2. cancel redundant collect_cpu_info at microcode.c level, use
relative function at microcode driver level;
3. separate microcode_resume_cpu from microcode_update_cpu, because
it's redundant (should only be called when S3 wakeup) and will block newer
microcode update when user update newer microcode.dat from user level
Keir Fraser [Thu, 22 Jan 2009 11:05:54 +0000 (11:05 +0000)]
x86: Make the num_siblings CPU parameter per-CPU.
While it is unlikely that a system has a different number of siblings
for different physical CPUs, make this parameter per-CPU for
consistency, and deal with the (so far theoretical) case that this is
different per CPU package.
Signed-off-by: Frank van der Linden <Frank.Vanderlinden@Sun.COM>
Keir Fraser [Tue, 20 Jan 2009 15:10:28 +0000 (15:10 +0000)]
hvmloader: ACPI compiler is not to be buil;t and installed on target system.
Since it is a build prerequisite (in some cases) simply fail the build
if it is not found when it turns out to be required. Just as we would
for any other tool-chain prereq.
Keir Fraser [Tue, 20 Jan 2009 13:27:08 +0000 (13:27 +0000)]
x86: update microcode support
- Container header file holding the patches changed. Update to new
format.
- in cpu_request_microcode() move heap re-allocation & copy out of the
loop.
Side-effect: Remove limitation in only supporting fixed sized
microcode patches. Also simplifies code a lot.
- cleanup: use rdmsr and wrmsrl instead of inlined assembler
- pass ucode_cpu_info as arguments. Improves reentrancy.
- cleanup: simplify struct ucode_cpu_info and remove
get_matching_microcode hook. Side-effect: reduces kernel size.
- bugfix: fix xen kernel memory leak in error path. equiv_cpu_table
was not freed.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Keir Fraser [Tue, 20 Jan 2009 13:22:28 +0000 (13:22 +0000)]
passthrough: fix typo
The indentation level of the following code was incidentally
changed when event_lock was added to protect dpci.
It causes no issue but does look a little weird, so fix it.
Keir Fraser [Fri, 16 Jan 2009 11:47:21 +0000 (11:47 +0000)]
[IA64] fix compilation error caused by 19046:ecf603780f56
This patch fixes the following compilation error adjusting
function prototypes.
> xc_core_ia64.c:176: error: conflicting types for
'xc_core_arch_memory_map_get'
> xc_core.h:141: error: previous declaration of
'xc_core_arch_memory_map_get' was here
> xc_core_ia64.c:241: error: conflicting types for
'xc_core_arch_map_p2m'
> xc_core.h:144: error: previous declaration of 'xc_core_arch_map_p2m'
was here
Keir Fraser [Thu, 15 Jan 2009 12:37:42 +0000 (12:37 +0000)]
libxc: Support cross-bitness guest when core-dumping
This patch allows core-dumping to work on a cross-bit host/guest
configuration, whereas previously that was not supported. It supports
both PV and FV guests. The core file format generated by the host,
needs to match that of the guest, so an alignment issue is addressed,
along with the p2m frame list handling being done according to the
guest size.
Keir Fraser [Thu, 15 Jan 2009 12:36:29 +0000 (12:36 +0000)]
xenoprof: The checks in the function passive_domain_do_rdmsr() were
not sufficient.
Also the same checks were done in the function
passive_domain_do_wrmsr().
So these common checks are moved in a new single function
passive_domain_msr_op_checks().
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Keir Fraser [Wed, 14 Jan 2009 10:56:18 +0000 (10:56 +0000)]
x86: propagate disabled APIC state to Dom0
This in particular eliminates the need to specify "noapic" to Dom0
when "noapic" is passed to Xen, provided the kernel side gets slightly
modified to make use of this information (Linux side patch cannot
easily be provided for the 2.6.18 tree, but this is being used by our
2.6.27-based one).
Keir Fraser [Wed, 14 Jan 2009 10:55:40 +0000 (10:55 +0000)]
x86: restore ability to work on systems without APIC
This got broken with the default-enabling of MSI. Apart from fixing
the base issue, the patch also addresses
- the 'i' command crashing where there is no IO-APIC,
- the 'i' command needlessly printing information for all 256 vectors
when the use of IO-APIC(s) is disabled, and
- the need to specify both "nolapic" and "noapic" when "nolapic" alone
should already have the intended effect.
Keir Fraser [Wed, 14 Jan 2009 10:51:58 +0000 (10:51 +0000)]
x86, hvm: stdvga improvements
* enables linear framebuffer and VBE 3.0 extensions.
* add a number of new resolutions, up to 2560x1600, and including
* widescreen modes common to modern displays.
* Introduce configurable video ram size through the "videoram" config
* file option, shrinking default video ram used to 4 Megs (thus
* eliminating 4 wasted megs/VM that have been the case until now), but
* allowing users to specify up to 16 Megs of vram, to support the
* extreme high resolutions such as 2560x1600x32.
Keir Fraser [Tue, 13 Jan 2009 15:29:06 +0000 (15:29 +0000)]
xend: fix ballooning bug
c/s 18960 introduced a bug when xend balloons memory. The function
balloon.free requires a reference to a XendDomainInfo object, which is
missing in one call of this function. Attached patch fixes this. Also
replaced the variable name "self" in the (classless) function with
something more descriptive.
Signed-off-by: Andre Przywara <andre.przywara@amd.com> Reported-by: Maik Hentsche <maik.hentsche@amd.com>
Keir Fraser [Tue, 13 Jan 2009 15:16:46 +0000 (15:16 +0000)]
AMD IOMMU: Reset tail and head pointer of cmd buffer and event log
Reset the tail and the head pointers of command buffer and event log
to zero in case that iommu does not reset them after the base
addresses of those buffers are updated.
Keir Fraser [Tue, 13 Jan 2009 08:59:49 +0000 (08:59 +0000)]
build: Define cc-option-add to immediately add options to CFLAGS
without deferring the test execution of CC. This avoids extra
executions of CC every time CFLAGS is expanded.
Keir Fraser [Mon, 12 Jan 2009 10:17:12 +0000 (10:17 +0000)]
Do not print `***' when compiling unless we fall over
This has finally bugged me enough to do something about it:
make prints `***' when it stops due to an error. With make -j, and/or
with automated build systems, this error marker can be in the middle
of a large logfile. It is useful to be able to search for it.
Therefore change occurrences of `*' to `=' for information and warning
messages. `***' is reserved for cases where the build stops.
A corresponding change is being applied to qemu-xen-unstable.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Mon, 12 Jan 2009 10:16:05 +0000 (10:16 +0000)]
Use -MMD -MF in tools/* rather than -Wp,-M...
If you use -MMD -MF then the correct .o filename is written to the
.*.d file as the compiler driver arranges everything. This was done
in 19010:275abe1c5d24 for the hypervisor.
In this patch we do the same elsewhere in the xen-unstable tree,
particularly tools/. Specifically:
* Change tools/Rules.mk to add -MMD -MF ... to CFLAGS and set DEPS.
* Remove -Wp,-MD... from every other Makefile
* Remove setting of DEPS from every other Makefile
* Ensure that every Makefile says -include $(DEPS)
* Ensure that every Makefile's clean target removes $(DEPS)
Some Makefiles were already halfway there, but often for a different
variable name eg PROG_DEP. The variable name is now standardised in
Rules.mk as DEPS.
I have done a test build with this change, on Debian etch.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Fri, 9 Jan 2009 16:56:54 +0000 (16:56 +0000)]
stubdom: Fix compilation after libelf header changes
Changeset 19011:7df072566b8c moved some of the libelf headers.
However, no changes were made to stubdom/Makefile.
stubdom/Makefile unfortunately contains embedded in it knowledge about
the header directory structures, and must therefore typically be
updated if new header directories are created.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Fri, 9 Jan 2009 10:04:24 +0000 (10:04 +0000)]
xend: Fix a ssl migration hang issue
When another VM is started by xend, the spawned qemu process will keep
the p2cwrite file descriptor open.
Thus there will be two open descriptors associated with the write end
of the pipe. The read end of the pipe only sees EOF when the qemu
process has terminated.
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Keir Fraser [Thu, 8 Jan 2009 15:27:20 +0000 (15:27 +0000)]
x86, hvm: Move E820 table creation into hvmloader, extend
hvm_info_table to describe memory parameters in a simpler form from
domain builder to hvmloader.
Also move reserved special page mappings immediately below the 4GB
boundary.
Keir Fraser [Thu, 8 Jan 2009 11:32:39 +0000 (11:32 +0000)]
x86-64: guest directed placement of initial p->m map
By adding another ELF note, the kernel can now direct the hypervisor
(for Dom0) and in the future also the tools (for DomU-s) to place the
initial phys->mach translation table at other than an address
immediately above the kernel/initrd images. This eliminates the size
restriction imposed on this table by Linux (the kernel loads above the
-2Gb boundary, and hence the entire initial mapping cannot reach or
even exceed 2Gb).
There are a few items in this patch I'm not particularly happy with,
but couldn't think of a better solution:
- there is a hidden assumption that pages allocated for the domain are
put on the domain's page list sequentially
- the way backward compatibility is maintained is placing requirements
on the kernel side that make the code somewhat convoluted (because
it
needs to check where the map is actually placed in quite a few
places)
- code is there to use 1Gb mappings for the hypervisor created table,
but lacking a machine with 512G+ memory for immediate testing I
can't
verify this works; I know that 2Mb mappings work, and hence imply
that 1Gb ones would too (of course, if the kernel replaces the table
- like Linux does -, it cannot use 2Mb/1Gb mappings or even try to
re-use the page table entries, but I don't consider this a problem)
Keir Fraser [Thu, 8 Jan 2009 11:26:58 +0000 (11:26 +0000)]
pci: add config options for MSI-INTx translation in HVM
Add a config file option 'pci_msitranslate' to enable MSI-INTx
translation in HVM, and also a per-device option 'msitranslate' to
allow device base to be overridden
Keir Fraser [Thu, 8 Jan 2009 11:25:43 +0000 (11:25 +0000)]
pci: add pci option support for XML-RPC server
Allow the per-device options for passthrough pci devices
for exmaple, in domain config file:
pci = ['01:00.0,opt1=val1,opt2=val2', '01:00.1' ]
or in the PCI hotplug case:
xm pci-attach -o opt1=val1 --options=opt2=val2 <domid> 01:00.0 6
Keir Fraser [Thu, 8 Jan 2009 11:25:06 +0000 (11:25 +0000)]
passthrough: MSI-INTx translation for HVM
The patch adds a new type of pt_irq: PT_IRQ_TYPE_MSI_TRANSLATE.
With it, guest dpci irq can now use msi as the underlying pirq
while injected as INTx irq.